;/*!/dep/jquery.cookie/jquery.cookie.js*/
/*!
 * jQuery Cookie Plugin v1.4.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
(function (factory) {
	if (typeof define === 'function' && define.amd) {
		// AMD
		define('dep/jquery.cookie/jquery.cookie', ['jquery'], factory);
	} else if (typeof exports === 'object') {
		// CommonJS
		factory(require('jquery'));
	} else {
		// Browser globals
		factory(jQuery);
	}
}(function ($) {

	var pluses = /\+/g;

	function encode(s) {
		return config.raw ? s : encodeURIComponent(s);
	}

	function decode(s) {
		return config.raw ? s : decodeURIComponent(s);
	}

	function stringifyCookieValue(value) {
		return encode(config.json ? JSON.stringify(value) : String(value));
	}

	function parseCookieValue(s) {
		if (s.indexOf('"') === 0) {
			// This is a quoted cookie as according to RFC2068, unescape...
			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
		}

		try {
			// Replace server-side written pluses with spaces.
			// If we can't decode the cookie, ignore it, it's unusable.
			// If we can't parse the cookie, ignore it, it's unusable.
			s = decodeURIComponent(s.replace(pluses, ' '));
			return config.json ? JSON.parse(s) : s;
		} catch(e) {}
	}

	function read(s, converter) {
		var value = config.raw ? s : parseCookieValue(s);
		return $.isFunction(converter) ? converter(value) : value;
	}

	var config = $.cookie = function (key, value, options) {

		// Write

		if (value !== undefined && !$.isFunction(value)) {
			options = $.extend({}, config.defaults, options);

			if (typeof options.expires === 'number') {
				var days = options.expires, t = options.expires = new Date();
				t.setTime(+t + days * 864e+5);
			}

			return (document.cookie = [
				encode(key), '=', stringifyCookieValue(value),
				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
				options.path    ? '; path=' + options.path : '',
				options.domain  ? '; domain=' + options.domain : '',
				options.secure  ? '; secure' : ''
			].join(''));
		}

		// Read

		var result = key ? undefined : {};

		// To prevent the for loop in the first place assign an empty array
		// in case there are no cookies at all. Also prevents odd result when
		// calling $.cookie().
		var cookies = document.cookie ? document.cookie.split('; ') : [];

		for (var i = 0, l = cookies.length; i < l; i++) {
			var parts = cookies[i].split('=');
			var name = decode(parts.shift());
			var cookie = parts.join('=');

			if (key && key === name) {
				// If second argument (value) is a function it's a converter...
				result = read(cookie, value);
				break;
			}

			// Prevent storing a cookie that we couldn't decode.
			if (!key && (cookie = read(cookie)) !== undefined) {
				result[name] = cookie;
			}
		}

		return result;
	};

	config.defaults = {};

	$.removeCookie = function (key, options) {
		if ($.cookie(key) === undefined) {
			return false;
		}

		// Must not alter options, thus extending a fresh object...
		$.cookie(key, '', $.extend({}, options, { expires: -1 }));
		return !$.cookie(key);
	};

}));

;/*!/dep/jquery-colorbox/jquery.colorbox.js*/
define('dep/jquery-colorbox/jquery.colorbox', ['require', 'exports', 'module'], function(require, exports, module) {

  /*!
  	Colorbox 1.6.3
  	license: MIT
  	http://www.jacklmoore.com/colorbox
  */
  (function ($, document, window) {
  	var
  	// Default settings object.
  	// See http://jacklmoore.com/colorbox for details.
  	defaults = {
  		// data sources
  		html: false,
  		photo: false,
  		iframe: false,
  		inline: false,
  
  		// behavior and appearance
  		transition: "elastic",
  		speed: 300,
  		fadeOut: 300,
  		width: false,
  		initialWidth: "600",
  		innerWidth: false,
  		maxWidth: false,
  		height: false,
  		initialHeight: "450",
  		innerHeight: false,
  		maxHeight: false,
  		scalePhotos: true,
  		scrolling: true,
  		opacity: 0.9,
  		preloading: true,
  		className: false,
  		overlayClose: true,
  		escKey: true,
  		arrowKey: true,
  		top: false,
  		bottom: false,
  		left: false,
  		right: false,
  		fixed: false,
  		data: undefined,
  		closeButton: true,
  		fastIframe: true,
  		open: false,
  		reposition: true,
  		loop: true,
  		slideshow: false,
  		slideshowAuto: true,
  		slideshowSpeed: 2500,
  		slideshowStart: "start slideshow",
  		slideshowStop: "stop slideshow",
  		photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,
  
  		// alternate image paths for high-res displays
  		retinaImage: false,
  		retinaUrl: false,
  		retinaSuffix: '@2x.$1',
  
  		// internationalization
  		current: "image {current} of {total}",
  		previous: "previous",
  		next: "next",
  		close: "close",
  		xhrError: "This content failed to load.",
  		imgError: "This image failed to load.",
  
  		// accessbility
  		returnFocus: true,
  		trapFocus: true,
  
  		// callbacks
  		onOpen: false,
  		onLoad: false,
  		onComplete: false,
  		onCleanup: false,
  		onClosed: false,
  
  		rel: function() {
  			return this.rel;
  		},
  		href: function() {
  			// using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container')
  			return $(this).attr('href');
  		},
  		title: function() {
  			return this.title;
  		},
  		createImg: function() {
  			var img = new Image();
  			var attrs = $(this).data('cbox-img-attrs');
  
  			if (typeof attrs === 'object') {
  				$.each(attrs, function(key, val){
  					img[key] = val;
  				});
  			}
  
  			return img;
  		},
  		createIframe: function() {
  			var iframe = document.createElement('iframe');
  			var attrs = $(this).data('cbox-iframe-attrs');
  
  			if (typeof attrs === 'object') {
  				$.each(attrs, function(key, val){
  					iframe[key] = val;
  				});
  			}
  
  			if ('frameBorder' in iframe) {
  				iframe.frameBorder = 0;
  			}
  			if ('allowTransparency' in iframe) {
  				iframe.allowTransparency = "true";
  			}
  			iframe.name = (new Date()).getTime(); // give the iframe a unique name to prevent caching
  			iframe.allowFullscreen = true;
  
  			return iframe;
  		}
  	},
  
  	// Abstracting the HTML and event identifiers for easy rebranding
  	colorbox = 'colorbox',
  	prefix = 'cbox',
  	boxElement = prefix + 'Element',
  
  	// Events
  	event_open = prefix + '_open',
  	event_load = prefix + '_load',
  	event_complete = prefix + '_complete',
  	event_cleanup = prefix + '_cleanup',
  	event_closed = prefix + '_closed',
  	event_purge = prefix + '_purge',
  
  	// Cached jQuery Object Variables
  	$overlay,
  	$box,
  	$wrap,
  	$content,
  	$topBorder,
  	$leftBorder,
  	$rightBorder,
  	$bottomBorder,
  	$related,
  	$window,
  	$loaded,
  	$loadingBay,
  	$loadingOverlay,
  	$title,
  	$current,
  	$slideshow,
  	$next,
  	$prev,
  	$close,
  	$groupControls,
  	$events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2
  
  	// Variables for cached values or use across multiple functions
  	settings,
  	interfaceHeight,
  	interfaceWidth,
  	loadedHeight,
  	loadedWidth,
  	index,
  	photo,
  	open,
  	active,
  	closing,
  	loadingTimer,
  	publicMethod,
  	div = "div",
  	requests = 0,
  	previousCSS = {},
  	init;
  
  	// ****************
  	// HELPER FUNCTIONS
  	// ****************
  
  	// Convenience function for creating new jQuery objects
  	function $tag(tag, id, css) {
  		var element = document.createElement(tag);
  
  		if (id) {
  			element.id = prefix + id;
  		}
  
  		if (css) {
  			element.style.cssText = css;
  		}
  
  		return $(element);
  	}
  
  	// Get the window height using innerHeight when available to avoid an issue with iOS
  	// http://bugs.jquery.com/ticket/6724
  	function winheight() {
  		return window.innerHeight ? window.innerHeight : $(window).height();
  	}
  
  	function Settings(element, options) {
  		if (options !== Object(options)) {
  			options = {};
  		}
  
  		this.cache = {};
  		this.el = element;
  
  		this.value = function(key) {
  			var dataAttr;
  
  			if (this.cache[key] === undefined) {
  				dataAttr = $(this.el).attr('data-cbox-'+key);
  
  				if (dataAttr !== undefined) {
  					this.cache[key] = dataAttr;
  				} else if (options[key] !== undefined) {
  					this.cache[key] = options[key];
  				} else if (defaults[key] !== undefined) {
  					this.cache[key] = defaults[key];
  				}
  			}
  
  			return this.cache[key];
  		};
  
  		this.get = function(key) {
  			var value = this.value(key);
  			return $.isFunction(value) ? value.call(this.el, this) : value;
  		};
  	}
  
  	// Determine the next and previous members in a group.
  	function getIndex(increment) {
  		var
  		max = $related.length,
  		newIndex = (index + increment) % max;
  
  		return (newIndex < 0) ? max + newIndex : newIndex;
  	}
  
  	// Convert '%' and 'px' values to integers
  	function setSize(size, dimension) {
  		return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
  	}
  
  	// Checks an href to see if it is a photo.
  	// There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
  	function isImage(settings, url) {
  		return settings.get('photo') || settings.get('photoRegex').test(url);
  	}
  
  	function retinaUrl(settings, url) {
  		return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url;
  	}
  
  	function trapFocus(e) {
  		if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) {
  			e.stopPropagation();
  			$box.focus();
  		}
  	}
  
  	function setClass(str) {
  		if (setClass.str !== str) {
  			$box.add($overlay).removeClass(setClass.str).addClass(str);
  			setClass.str = str;
  		}
  	}
  
  	function getRelated(rel) {
  		index = 0;
  
  		if (rel && rel !== false && rel !== 'nofollow') {
  			$related = $('.' + boxElement).filter(function () {
  				var options = $.data(this, colorbox);
  				var settings = new Settings(this, options);
  				return (settings.get('rel') === rel);
  			});
  			index = $related.index(settings.el);
  
  			// Check direct calls to Colorbox.
  			if (index === -1) {
  				$related = $related.add(settings.el);
  				index = $related.length - 1;
  			}
  		} else {
  			$related = $(settings.el);
  		}
  	}
  
  	function trigger(event) {
  		// for external use
  		$(document).trigger(event);
  		// for internal use
  		$events.triggerHandler(event);
  	}
  
  	var slideshow = (function(){
  		var active,
  			className = prefix + "Slideshow_",
  			click = "click." + prefix,
  			timeOut;
  
  		function clear () {
  			clearTimeout(timeOut);
  		}
  
  		function set() {
  			if (settings.get('loop') || $related[index + 1]) {
  				clear();
  				timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed'));
  			}
  		}
  
  		function start() {
  			$slideshow
  				.html(settings.get('slideshowStop'))
  				.unbind(click)
  				.one(click, stop);
  
  			$events
  				.bind(event_complete, set)
  				.bind(event_load, clear);
  
  			$box.removeClass(className + "off").addClass(className + "on");
  		}
  
  		function stop() {
  			clear();
  
  			$events
  				.unbind(event_complete, set)
  				.unbind(event_load, clear);
  
  			$slideshow
  				.html(settings.get('slideshowStart'))
  				.unbind(click)
  				.one(click, function () {
  					publicMethod.next();
  					start();
  				});
  
  			$box.removeClass(className + "on").addClass(className + "off");
  		}
  
  		function reset() {
  			active = false;
  			$slideshow.hide();
  			clear();
  			$events
  				.unbind(event_complete, set)
  				.unbind(event_load, clear);
  			$box.removeClass(className + "off " + className + "on");
  		}
  
  		return function(){
  			if (active) {
  				if (!settings.get('slideshow')) {
  					$events.unbind(event_cleanup, reset);
  					reset();
  				}
  			} else {
  				if (settings.get('slideshow') && $related[1]) {
  					active = true;
  					$events.one(event_cleanup, reset);
  					if (settings.get('slideshowAuto')) {
  						start();
  					} else {
  						stop();
  					}
  					$slideshow.show();
  				}
  			}
  		};
  
  	}());
  
  
  	function launch(element) {
  		var options;
  
  		if (!closing) {
  
  			options = $(element).data(colorbox);
  
  			settings = new Settings(element, options);
  
  			getRelated(settings.get('rel'));
  
  			if (!open) {
  				open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
  
  				setClass(settings.get('className'));
  
  				// Show colorbox so the sizes can be calculated in older versions of jQuery
  				$box.css({visibility:'hidden', display:'block', opacity:''});
  
  				$loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden');
  				$content.css({width:'', height:''}).append($loaded);
  
  				// Cache values needed for size calculations
  				interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
  				interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
  				loadedHeight = $loaded.outerHeight(true);
  				loadedWidth = $loaded.outerWidth(true);
  
  				// Opens inital empty Colorbox prior to content being loaded.
  				var initialWidth = setSize(settings.get('initialWidth'), 'x');
  				var initialHeight = setSize(settings.get('initialHeight'), 'y');
  				var maxWidth = settings.get('maxWidth');
  				var maxHeight = settings.get('maxHeight');
  
  				settings.w = Math.max((maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth, 0);
  				settings.h = Math.max((maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight, 0);
  
  				$loaded.css({width:'', height:settings.h});
  				publicMethod.position();
  
  				trigger(event_open);
  				settings.get('onOpen');
  
  				$groupControls.add($title).hide();
  
  				$box.focus();
  
  				if (settings.get('trapFocus')) {
  					// Confine focus to the modal
  					// Uses event capturing that is not supported in IE8-
  					if (document.addEventListener) {
  
  						document.addEventListener('focus', trapFocus, true);
  
  						$events.one(event_closed, function () {
  							document.removeEventListener('focus', trapFocus, true);
  						});
  					}
  				}
  
  				// Return focus on closing
  				if (settings.get('returnFocus')) {
  					$events.one(event_closed, function () {
  						$(settings.el).focus();
  					});
  				}
  			}
  
  			var opacity = parseFloat(settings.get('opacity'));
  			$overlay.css({
  				opacity: opacity === opacity ? opacity : '',
  				cursor: settings.get('overlayClose') ? 'pointer' : '',
  				visibility: 'visible'
  			}).show();
  
  			if (settings.get('closeButton')) {
  				$close.html(settings.get('close')).appendTo($content);
  			} else {
  				$close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4
  			}
  
  			load();
  		}
  	}
  
  	// Colorbox's markup needs to be added to the DOM prior to being called
  	// so that the browser will go ahead and load the CSS background images.
  	function appendHTML() {
  		if (!$box) {
  			init = false;
  			$window = $(window);
  			$box = $tag(div).attr({
  				id: colorbox,
  				'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
  				role: 'dialog',
  				tabindex: '-1'
  			}).hide();
  			$overlay = $tag(div, "Overlay").hide();
  			$loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
  			$wrap = $tag(div, "Wrapper");
  			$content = $tag(div, "Content").append(
  				$title = $tag(div, "Title"),
  				$current = $tag(div, "Current"),
  				$prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
  				$next = $('<button type="button"/>').attr({id:prefix+'Next'}),
  				$slideshow = $tag('button', "Slideshow"),
  				$loadingOverlay
  			);
  
  			$close = $('<button type="button"/>').attr({id:prefix+'Close'});
  
  			$wrap.append( // The 3x3 Grid that makes up Colorbox
  				$tag(div).append(
  					$tag(div, "TopLeft"),
  					$topBorder = $tag(div, "TopCenter"),
  					$tag(div, "TopRight")
  				),
  				$tag(div, false, 'clear:left').append(
  					$leftBorder = $tag(div, "MiddleLeft"),
  					$content,
  					$rightBorder = $tag(div, "MiddleRight")
  				),
  				$tag(div, false, 'clear:left').append(
  					$tag(div, "BottomLeft"),
  					$bottomBorder = $tag(div, "BottomCenter"),
  					$tag(div, "BottomRight")
  				)
  			).find('div div').css({'float': 'left'});
  
  			$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
  
  			$groupControls = $next.add($prev).add($current).add($slideshow);
  		}
  		if (document.body && !$box.parent().length) {
  			$(document.body).append($overlay, $box.append($wrap, $loadingBay));
  		}
  	}
  
  	// Add Colorbox's event bindings
  	function addBindings() {
  		function clickHandler(e) {
  			// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
  			// See: http://jacklmoore.com/notes/click-events/
  			if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
  				e.preventDefault();
  				launch(this);
  			}
  		}
  
  		if ($box) {
  			if (!init) {
  				init = true;
  
  				// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
  				$next.click(function () {
  					publicMethod.next();
  				});
  				$prev.click(function () {
  					publicMethod.prev();
  				});
  				$close.click(function () {
  					publicMethod.close();
  				});
  				$overlay.click(function () {
  					if (settings.get('overlayClose')) {
  						publicMethod.close();
  					}
  				});
  
  				// Key Bindings
  				$(document).bind('keydown.' + prefix, function (e) {
  					var key = e.keyCode;
  					if (open && settings.get('escKey') && key === 27) {
  						e.preventDefault();
  						publicMethod.close();
  					}
  					if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
  						if (key === 37) {
  							e.preventDefault();
  							$prev.click();
  						} else if (key === 39) {
  							e.preventDefault();
  							$next.click();
  						}
  					}
  				});
  
  				if ($.isFunction($.fn.on)) {
  					// For jQuery 1.7+
  					$(document).on('click.'+prefix, '.'+boxElement, clickHandler);
  				} else {
  					// For jQuery 1.3.x -> 1.6.x
  					// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
  					// This is not here for jQuery 1.9, it's here for legacy users.
  					$('.'+boxElement).live('click.'+prefix, clickHandler);
  				}
  			}
  			return true;
  		}
  		return false;
  	}
  
  	// Don't do anything if Colorbox already exists.
  	if ($[colorbox]) {
  		return;
  	}
  
  	// Append the HTML when the DOM loads
  	$(appendHTML);
  
  
  	// ****************
  	// PUBLIC FUNCTIONS
  	// Usage format: $.colorbox.close();
  	// Usage from within an iframe: parent.jQuery.colorbox.close();
  	// ****************
  
  	publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
  		var settings;
  		var $obj = this;
  
  		options = options || {};
  
  		if ($.isFunction($obj)) { // assume a call to $.colorbox
  			$obj = $('<a/>');
  			options.open = true;
  		}
  
  		if (!$obj[0]) { // colorbox being applied to empty collection
  			return $obj;
  		}
  
  		appendHTML();
  
  		if (addBindings()) {
  
  			if (callback) {
  				options.onComplete = callback;
  			}
  
  			$obj.each(function () {
  				var old = $.data(this, colorbox) || {};
  				$.data(this, colorbox, $.extend(old, options));
  			}).addClass(boxElement);
  
  			settings = new Settings($obj[0], options);
  
  			if (settings.get('open')) {
  				launch($obj[0]);
  			}
  		}
  
  		return $obj;
  	};
  
  	publicMethod.position = function (speed, loadedCallback) {
  		var
  		css,
  		top = 0,
  		left = 0,
  		offset = $box.offset(),
  		scrollTop,
  		scrollLeft;
  
  		$window.unbind('resize.' + prefix);
  
  		// remove the modal so that it doesn't influence the document width/height
  		$box.css({top: -9e4, left: -9e4});
  
  		scrollTop = $window.scrollTop();
  		scrollLeft = $window.scrollLeft();
  
  		if (settings.get('fixed')) {
  			offset.top -= scrollTop;
  			offset.left -= scrollLeft;
  			$box.css({position: 'fixed'});
  		} else {
  			top = scrollTop;
  			left = scrollLeft;
  			$box.css({position: 'absolute'});
  		}
  
  		// keeps the top and left positions within the browser's viewport.
  		if (settings.get('right') !== false) {
  			left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0);
  		} else if (settings.get('left') !== false) {
  			left += setSize(settings.get('left'), 'x');
  		} else {
  			left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
  		}
  
  		if (settings.get('bottom') !== false) {
  			top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0);
  		} else if (settings.get('top') !== false) {
  			top += setSize(settings.get('top'), 'y');
  		} else {
  			top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
  		}
  
  		$box.css({top: offset.top, left: offset.left, visibility:'visible'});
  
  		// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
  		// but it has to be shrank down around the size of div#colorbox when it's done.  If not,
  		// it can invoke an obscure IE bug when using iframes.
  		$wrap[0].style.width = $wrap[0].style.height = "9999px";
  
  		function modalDimensions() {
  			$topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
  			$content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
  		}
  
  		css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
  
  		// setting the speed to 0 if the content hasn't changed size or position
  		if (speed) {
  			var tempSpeed = 0;
  			$.each(css, function(i){
  				if (css[i] !== previousCSS[i]) {
  					tempSpeed = speed;
  					return;
  				}
  			});
  			speed = tempSpeed;
  		}
  
  		previousCSS = css;
  
  		if (!speed) {
  			$box.css(css);
  		}
  
  		$box.dequeue().animate(css, {
  			duration: speed || 0,
  			complete: function () {
  				modalDimensions();
  
  				active = false;
  
  				// shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
  				$wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
  				$wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
  
  				if (settings.get('reposition')) {
  					setTimeout(function () {  // small delay before binding onresize due to an IE8 bug.
  						$window.bind('resize.' + prefix, publicMethod.position);
  					}, 1);
  				}
  
  				if ($.isFunction(loadedCallback)) {
  					loadedCallback();
  				}
  			},
  			step: modalDimensions
  		});
  	};
  
  	publicMethod.resize = function (options) {
  		var scrolltop;
  
  		if (open) {
  			options = options || {};
  
  			if (options.width) {
  				settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
  			}
  
  			if (options.innerWidth) {
  				settings.w = setSize(options.innerWidth, 'x');
  			}
  
  			$loaded.css({width: settings.w});
  
  			if (options.height) {
  				settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
  			}
  
  			if (options.innerHeight) {
  				settings.h = setSize(options.innerHeight, 'y');
  			}
  
  			if (!options.innerHeight && !options.height) {
  				scrolltop = $loaded.scrollTop();
  				$loaded.css({height: "auto"});
  				settings.h = $loaded.height();
  			}
  
  			$loaded.css({height: settings.h});
  
  			if(scrolltop) {
  				$loaded.scrollTop(scrolltop);
  			}
  
  			publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed'));
  		}
  	};
  
  	publicMethod.prep = function (object) {
  		if (!open) {
  			return;
  		}
  
  		var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed');
  
  		$loaded.remove();
  
  		$loaded = $tag(div, 'LoadedContent').append(object);
  
  		function getWidth() {
  			settings.w = settings.w || $loaded.width();
  			settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
  			return settings.w;
  		}
  		function getHeight() {
  			settings.h = settings.h || $loaded.height();
  			settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
  			return settings.h;
  		}
  
  		$loaded.hide()
  		.appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
  		.css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'})
  		.css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
  		.prependTo($content);
  
  		$loadingBay.hide();
  
  		// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
  
  		$(photo).css({'float': 'none'});
  
  		setClass(settings.get('className'));
  
  		callback = function () {
  			var total = $related.length,
  				iframe,
  				complete;
  
  			if (!open) {
  				return;
  			}
  
  			function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2
  				if ($.support.opacity === false) {
  					$box[0].style.removeAttribute('filter');
  				}
  			}
  
  			complete = function () {
  				clearTimeout(loadingTimer);
  				$loadingOverlay.hide();
  				trigger(event_complete);
  				settings.get('onComplete');
  			};
  
  
  			$title.html(settings.get('title')).show();
  			$loaded.show();
  
  			if (total > 1) { // handle grouping
  				if (typeof settings.get('current') === "string") {
  					$current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show();
  				}
  
  				$next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next'));
  				$prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous'));
  
  				slideshow();
  
  				// Preloads images within a rel group
  				if (settings.get('preloading')) {
  					$.each([getIndex(-1), getIndex(1)], function(){
  						var img,
  							i = $related[this],
  							settings = new Settings(i, $.data(i, colorbox)),
  							src = settings.get('href');
  
  						if (src && isImage(settings, src)) {
  							src = retinaUrl(settings, src);
  							img = document.createElement('img');
  							img.src = src;
  						}
  					});
  				}
  			} else {
  				$groupControls.hide();
  			}
  
  			if (settings.get('iframe')) {
  
  				iframe = settings.get('createIframe');
  
  				if (!settings.get('scrolling')) {
  					iframe.scrolling = "no";
  				}
  
  				$(iframe)
  					.attr({
  						src: settings.get('href'),
  						'class': prefix + 'Iframe'
  					})
  					.one('load', complete)
  					.appendTo($loaded);
  
  				$events.one(event_purge, function () {
  					iframe.src = "//about:blank";
  				});
  
  				if (settings.get('fastIframe')) {
  					$(iframe).trigger('load');
  				}
  			} else {
  				complete();
  			}
  
  			if (settings.get('transition') === 'fade') {
  				$box.fadeTo(speed, 1, removeFilter);
  			} else {
  				removeFilter();
  			}
  		};
  
  		if (settings.get('transition') === 'fade') {
  			$box.fadeTo(speed, 0, function () {
  				publicMethod.position(0, callback);
  			});
  		} else {
  			publicMethod.position(speed, callback);
  		}
  	};
  
  	function load () {
  		var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
  
  		active = true;
  
  		photo = false;
  
  		trigger(event_purge);
  		trigger(event_load);
  		settings.get('onLoad');
  
  		settings.h = settings.get('height') ?
  				setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight :
  				settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y');
  
  		settings.w = settings.get('width') ?
  				setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth :
  				settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x');
  
  		// Sets the minimum dimensions for use in image scaling
  		settings.mw = settings.w;
  		settings.mh = settings.h;
  
  		// Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
  		// If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
  		if (settings.get('maxWidth')) {
  			settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth;
  			settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
  		}
  		if (settings.get('maxHeight')) {
  			settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight;
  			settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
  		}
  
  		href = settings.get('href');
  
  		loadingTimer = setTimeout(function () {
  			$loadingOverlay.show();
  		}, 100);
  
  		if (settings.get('inline')) {
  			var $target = $(href);
  			// Inserts an empty placeholder where inline content is being pulled from.
  			// An event is bound to put inline content back when Colorbox closes or loads new content.
  			$inline = $('<div>').hide().insertBefore($target);
  
  			$events.one(event_purge, function () {
  				$inline.replaceWith($target);
  			});
  
  			prep($target);
  		} else if (settings.get('iframe')) {
  			// IFrame element won't be added to the DOM until it is ready to be displayed,
  			// to avoid problems with DOM-ready JS that might be trying to run in that iframe.
  			prep(" ");
  		} else if (settings.get('html')) {
  			prep(settings.get('html'));
  		} else if (isImage(settings, href)) {
  
  			href = retinaUrl(settings, href);
  
  			photo = settings.get('createImg');
  
  			$(photo)
  			.addClass(prefix + 'Photo')
  			.bind('error.'+prefix,function () {
  				prep($tag(div, 'Error').html(settings.get('imgError')));
  			})
  			.one('load', function () {
  				if (request !== requests) {
  					return;
  				}
  
  				// A small pause because some browsers will occassionaly report a
  				// img.width and img.height of zero immediately after the img.onload fires
  				setTimeout(function(){
  					var percent;
  
  					if (settings.get('retinaImage') && window.devicePixelRatio > 1) {
  						photo.height = photo.height / window.devicePixelRatio;
  						photo.width = photo.width / window.devicePixelRatio;
  					}
  
  					if (settings.get('scalePhotos')) {
  						setResize = function () {
  							photo.height -= photo.height * percent;
  							photo.width -= photo.width * percent;
  						};
  						if (settings.mw && photo.width > settings.mw) {
  							percent = (photo.width - settings.mw) / photo.width;
  							setResize();
  						}
  						if (settings.mh && photo.height > settings.mh) {
  							percent = (photo.height - settings.mh) / photo.height;
  							setResize();
  						}
  					}
  
  					if (settings.h) {
  						photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
  					}
  
  					if ($related[1] && (settings.get('loop') || $related[index + 1])) {
  						photo.style.cursor = 'pointer';
  
  						$(photo).bind('click.'+prefix, function () {
  							publicMethod.next();
  						});
  					}
  
  					photo.style.width = photo.width + 'px';
  					photo.style.height = photo.height + 'px';
  					prep(photo);
  				}, 1);
  			});
  
  			photo.src = href;
  
  		} else if (href) {
  			$loadingBay.load(href, settings.get('data'), function (data, status) {
  				if (request === requests) {
  					prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents());
  				}
  			});
  		}
  	}
  
  	// Navigates to the next page/image in a set.
  	publicMethod.next = function () {
  		if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) {
  			index = getIndex(1);
  			launch($related[index]);
  		}
  	};
  
  	publicMethod.prev = function () {
  		if (!active && $related[1] && (settings.get('loop') || index)) {
  			index = getIndex(-1);
  			launch($related[index]);
  		}
  	};
  
  	// Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
  	publicMethod.close = function () {
  		if (open && !closing) {
  
  			closing = true;
  			open = false;
  			trigger(event_cleanup);
  			settings.get('onCleanup');
  			$window.unbind('.' + prefix);
  			$overlay.fadeTo(settings.get('fadeOut') || 0, 0);
  
  			$box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () {
  				$box.hide();
  				$overlay.hide();
  				trigger(event_purge);
  				$loaded.remove();
  
  				setTimeout(function () {
  					closing = false;
  					trigger(event_closed);
  					settings.get('onClosed');
  				}, 1);
  			});
  		}
  	};
  
  	// Removes changes Colorbox made to the document, but does not remove the plugin.
  	publicMethod.remove = function () {
  		if (!$box) { return; }
  
  		$box.stop();
  		$[colorbox].close();
  		$box.stop(false, true).remove();
  		$overlay.remove();
  		closing = false;
  		$box = null;
  		$('.' + boxElement)
  			.removeData(colorbox)
  			.removeClass(boxElement);
  
  		$(document).unbind('click.'+prefix).unbind('keydown.'+prefix);
  	};
  
  	// A method for fetching the current element Colorbox is referencing.
  	// returns a jQuery object.
  	publicMethod.element = function () {
  		return $(settings.el);
  	};
  
  	publicMethod.settings = defaults;
  
  }(jQuery, document, window));
  

});
;/*!/dep/jquery-mousewheel/jquery.mousewheel.js*/
/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */

(function (factory) {
    if ( typeof define === 'function' && define.amd ) {
        // AMD. Register as an anonymous module.
        define('dep/jquery-mousewheel/jquery.mousewheel', ['jquery'], factory);
    } else if (typeof exports === 'object') {
        // Node/CommonJS style for Browserify
        module.exports = factory;
    } else {
        // Browser globals
        factory(jQuery);
    }
}(function ($) {

    var toFix  = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
        toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
                    ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
        slice  = Array.prototype.slice,
        nullLowestDeltaTimeout, lowestDelta;

    if ( $.event.fixHooks ) {
        for ( var i = toFix.length; i; ) {
            $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
        }
    }

    var special = $.event.special.mousewheel = {
        version: '3.1.12',

        setup: function() {
            if ( this.addEventListener ) {
                for ( var i = toBind.length; i; ) {
                    this.addEventListener( toBind[--i], handler, false );
                }
            } else {
                this.onmousewheel = handler;
            }
            // Store the line height and page height for this particular element
            $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
            $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
        },

        teardown: function() {
            if ( this.removeEventListener ) {
                for ( var i = toBind.length; i; ) {
                    this.removeEventListener( toBind[--i], handler, false );
                }
            } else {
                this.onmousewheel = null;
            }
            // Clean up the data we added to the element
            $.removeData(this, 'mousewheel-line-height');
            $.removeData(this, 'mousewheel-page-height');
        },

        getLineHeight: function(elem) {
            var $elem = $(elem),
                $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
            if (!$parent.length) {
                $parent = $('body');
            }
            return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
        },

        getPageHeight: function(elem) {
            return $(elem).height();
        },

        settings: {
            adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
            normalizeOffset: true  // calls getBoundingClientRect for each event
        }
    };

    $.fn.extend({
        mousewheel: function(fn) {
            return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
        },

        unmousewheel: function(fn) {
            return this.unbind('mousewheel', fn);
        }
    });


    function handler(event) {
        var orgEvent   = event || window.event,
            args       = slice.call(arguments, 1),
            delta      = 0,
            deltaX     = 0,
            deltaY     = 0,
            absDelta   = 0,
            offsetX    = 0,
            offsetY    = 0;
        event = $.event.fix(orgEvent);
        event.type = 'mousewheel';

        // Old school scrollwheel delta
        if ( 'detail'      in orgEvent ) { deltaY = orgEvent.detail * -1;      }
        if ( 'wheelDelta'  in orgEvent ) { deltaY = orgEvent.wheelDelta;       }
        if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY;      }
        if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }

        // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
        if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
            deltaX = deltaY * -1;
            deltaY = 0;
        }

        // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
        delta = deltaY === 0 ? deltaX : deltaY;

        // New school wheel delta (wheel event)
        if ( 'deltaY' in orgEvent ) {
            deltaY = orgEvent.deltaY * -1;
            delta  = deltaY;
        }
        if ( 'deltaX' in orgEvent ) {
            deltaX = orgEvent.deltaX;
            if ( deltaY === 0 ) { delta  = deltaX * -1; }
        }

        // No change actually happened, no reason to go any further
        if ( deltaY === 0 && deltaX === 0 ) { return; }

        // Need to convert lines and pages to pixels if we aren't already in pixels
        // There are three delta modes:
        //   * deltaMode 0 is by pixels, nothing to do
        //   * deltaMode 1 is by lines
        //   * deltaMode 2 is by pages
        if ( orgEvent.deltaMode === 1 ) {
            var lineHeight = $.data(this, 'mousewheel-line-height');
            delta  *= lineHeight;
            deltaY *= lineHeight;
            deltaX *= lineHeight;
        } else if ( orgEvent.deltaMode === 2 ) {
            var pageHeight = $.data(this, 'mousewheel-page-height');
            delta  *= pageHeight;
            deltaY *= pageHeight;
            deltaX *= pageHeight;
        }

        // Store lowest absolute delta to normalize the delta values
        absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );

        if ( !lowestDelta || absDelta < lowestDelta ) {
            lowestDelta = absDelta;

            // Adjust older deltas if necessary
            if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
                lowestDelta /= 40;
            }
        }

        // Adjust older deltas if necessary
        if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
            // Divide all the things by 40!
            delta  /= 40;
            deltaX /= 40;
            deltaY /= 40;
        }

        // Get a whole, normalized value for the deltas
        delta  = Math[ delta  >= 1 ? 'floor' : 'ceil' ](delta  / lowestDelta);
        deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
        deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);

        // Normalise offsetX and offsetY properties
        if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
            var boundingRect = this.getBoundingClientRect();
            offsetX = event.clientX - boundingRect.left;
            offsetY = event.clientY - boundingRect.top;
        }

        // Add information to the event object
        event.deltaX = deltaX;
        event.deltaY = deltaY;
        event.deltaFactor = lowestDelta;
        event.offsetX = offsetX;
        event.offsetY = offsetY;
        // Go ahead and set deltaMode to 0 since we converted to pixels
        // Although this is a little odd since we overwrite the deltaX/Y
        // properties with normalized deltas.
        event.deltaMode = 0;

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);

        // Clearout lowestDelta after sometime to better
        // handle multiple device types that give different
        // a different lowestDelta
        // Ex: trackpad = 3 and mouse wheel = 120
        if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
        nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);

        return ($.event.dispatch || $.event.handle).apply(this, args);
    }

    function nullLowestDelta() {
        lowestDelta = null;
    }

    function shouldAdjustOldDeltas(orgEvent, absDelta) {
        // If this is an older event and the delta is divisable by 120,
        // then we are assuming that the browser is treating this as an
        // older mouse wheel event and that we should divide the deltas
        // by 40 to try and get a more usable deltaFactor.
        // Side note, this actually impacts the reported scroll distance
        // in older browsers and can cause scrolling to be slower than native.
        // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
        return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
    }

}));

;/*!/dep/mCustomScrollbar/js/jquery.mCustomScrollbar.js*/
define('dep/mCustomScrollbar/js/jquery.mCustomScrollbar', ['require', 'exports', 'module'], function(require, exports, module) {

  /*
  == malihu jquery custom scrollbars plugin == 
  version: 2.8.3 
  author: malihu (http://manos.malihu.gr) 
  plugin home: http://manos.malihu.gr/jquery-custom-content-scroller 
  */
  
  /*
  Copyright 2010-2013 Manos Malihutsakis 
  
  This program is free software: you can redistribute it and/or modify 
  it under the terms of the GNU Lesser General Public License as published by 
  the Free Software Foundation, either version 3 of the License, or 
  any later version. 
  
  This program is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  GNU Lesser General Public License for more details. 
  
  You should have received a copy of the GNU Lesser General Public License 
  along with this program.  If not, see http://www.gnu.org/licenses/lgpl.html. 
  */
  (function($){
  	/*plugin script*/
  	var methods={
  		init:function(options){
  			var defaults={ 
  				set_width:false, /*optional element width: boolean, pixels, percentage*/
  				set_height:false, /*optional element height: boolean, pixels, percentage*/
  				horizontalScroll:false, /*scroll horizontally: boolean*/
  				scrollInertia:950, /*scrolling inertia: integer (milliseconds)*/
  				mouseWheel:true, /*mousewheel support: boolean*/
  				mouseWheelPixels:"auto", /*mousewheel pixels amount: integer, "auto"*/
  				autoDraggerLength:true, /*auto-adjust scrollbar dragger length: boolean*/
  				autoHideScrollbar:false, /*auto-hide scrollbar when idle*/
  				alwaysShowScrollbar:false, /*always show scrollbar even when there's nothing to scroll (disables autoHideScrollbar): boolean*/
  				snapAmount:null, /* optional element always snaps to a multiple of this number in pixels */
  				snapOffset:0, /* when snapping, snap with this number in pixels as an offset */
  				scrollButtons:{ /*scroll buttons*/
  					enable:false, /*scroll buttons support: boolean*/
  					scrollType:"continuous", /*scroll buttons scrolling type: "continuous", "pixels"*/
  					scrollSpeed:"auto", /*scroll buttons continuous scrolling speed: integer, "auto"*/
  					scrollAmount:40 /*scroll buttons pixels scroll amount: integer (pixels)*/
  				},
  				advanced:{
  					updateOnBrowserResize:true, /*update scrollbars on browser resize (for layouts based on percentages): boolean*/
  					updateOnContentResize:false, /*auto-update scrollbars on content resize (for dynamic content): boolean*/
  					autoExpandHorizontalScroll:false, /*auto-expand width for horizontal scrolling: boolean*/
  					autoScrollOnFocus:true, /*auto-scroll on focused elements: boolean*/
  					normalizeMouseWheelDelta:false /*normalize mouse-wheel delta (-1/1)*/
  				},
  				contentTouchScroll:true, /*scrolling by touch-swipe content: boolean*/
  				callbacks:{
  					onScrollStart:function(){}, /*user custom callback function on scroll start event*/
  					onScroll:function(){}, /*user custom callback function on scroll event*/
  					onTotalScroll:function(){}, /*user custom callback function on scroll end reached event*/
  					onTotalScrollBack:function(){}, /*user custom callback function on scroll begin reached event*/
  					onTotalScrollOffset:0, /*scroll end reached offset: integer (pixels)*/
  					onTotalScrollBackOffset:0, /*scroll begin reached offset: integer (pixels)*/
  					whileScrolling:function(){} /*user custom callback function on scrolling event*/
  				},
  				theme:"light" /*"light", "dark", "light-2", "dark-2", "light-thick", "dark-thick", "light-thin", "dark-thin"*/
  			},
  			options=$.extend(true,defaults,options);
  			return this.each(function(){
  				var $this=$(this);
  				/*set element width/height, create markup for custom scrollbars, add classes*/
  				if(options.set_width){
  					$this.css("width",options.set_width);
  				}
  				if(options.set_height){
  					$this.css("height",options.set_height);
  				}
  				if(!$(document).data("mCustomScrollbar-index")){
  					$(document).data("mCustomScrollbar-index","1");
  				}else{
  					var mCustomScrollbarIndex=parseInt($(document).data("mCustomScrollbar-index"));
  					$(document).data("mCustomScrollbar-index",mCustomScrollbarIndex+1);
  				}
  				$this.wrapInner("<div class='mCustomScrollBox"+" mCS-"+options.theme+"' id='mCSB_"+$(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+$(document).data("mCustomScrollbar-index"));
  				var mCustomScrollBox=$this.children(".mCustomScrollBox");
  				if(options.horizontalScroll){
  					mCustomScrollBox.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");
  					var mCSB_h_wrapper=mCustomScrollBox.children(".mCSB_h_wrapper");
  					mCSB_h_wrapper.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({"width":mCSB_h_wrapper.children().outerWidth(),"position":"relative"}).unwrap();
  				}else{
  					mCustomScrollBox.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");
  				}
  				var mCSB_container=mCustomScrollBox.children(".mCSB_container");
  				if($.support.touch){
  					mCSB_container.addClass("mCS_touch");
  				}
  				mCSB_container.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");
  				var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
  					mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
  					mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");
  				if(options.horizontalScroll){
  					mCSB_dragger.data("minDraggerWidth",mCSB_dragger.width());
  				}else{
  					mCSB_dragger.data("minDraggerHeight",mCSB_dragger.height());
  				}
  				if(options.scrollButtons.enable){
  					if(options.horizontalScroll){
  						mCSB_scrollTools.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>");
  					}else{
  						mCSB_scrollTools.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>");
  					}
  				}
  				/*mCustomScrollBox scrollTop and scrollLeft is always 0 to prevent browser focus scrolling*/
  				mCustomScrollBox.bind("scroll",function(){
  					if(!$this.is(".mCS_disabled")){ /*native focus scrolling for disabled scrollbars*/
  						mCustomScrollBox.scrollTop(0).scrollLeft(0);
  					}
  				});
  				/*store options, global vars/states, intervals*/
  				$this.data({
  					/*init state*/
  					"mCS_Init":true,
  					/*instance index*/
  					"mCustomScrollbarIndex":$(document).data("mCustomScrollbar-index"),
  					/*option parameters*/
  					"horizontalScroll":options.horizontalScroll,
  					"scrollInertia":options.scrollInertia,
  					"scrollEasing":"mcsEaseOut",
  					"mouseWheel":options.mouseWheel,
  					"mouseWheelPixels":options.mouseWheelPixels,
  					"autoDraggerLength":options.autoDraggerLength,
  					"autoHideScrollbar":options.autoHideScrollbar,
  					"alwaysShowScrollbar":options.alwaysShowScrollbar,
  					"snapAmount":options.snapAmount,
  					"snapOffset":options.snapOffset,
  					"scrollButtons_enable":options.scrollButtons.enable,
  					"scrollButtons_scrollType":options.scrollButtons.scrollType,
  					"scrollButtons_scrollSpeed":options.scrollButtons.scrollSpeed,
  					"scrollButtons_scrollAmount":options.scrollButtons.scrollAmount,
  					"autoExpandHorizontalScroll":options.advanced.autoExpandHorizontalScroll,
  					"autoScrollOnFocus":options.advanced.autoScrollOnFocus,
  					"normalizeMouseWheelDelta":options.advanced.normalizeMouseWheelDelta,
  					"contentTouchScroll":options.contentTouchScroll,
  					"onScrollStart_Callback":options.callbacks.onScrollStart,
  					"onScroll_Callback":options.callbacks.onScroll,
  					"onTotalScroll_Callback":options.callbacks.onTotalScroll,
  					"onTotalScrollBack_Callback":options.callbacks.onTotalScrollBack,
  					"onTotalScroll_Offset":options.callbacks.onTotalScrollOffset,
  					"onTotalScrollBack_Offset":options.callbacks.onTotalScrollBackOffset,
  					"whileScrolling_Callback":options.callbacks.whileScrolling,
  					/*events binding state*/
  					"bindEvent_scrollbar_drag":false,
  					"bindEvent_content_touch":false,
  					"bindEvent_scrollbar_click":false,
  					"bindEvent_mousewheel":false,
  					"bindEvent_buttonsContinuous_y":false,
  					"bindEvent_buttonsContinuous_x":false,
  					"bindEvent_buttonsPixels_y":false,
  					"bindEvent_buttonsPixels_x":false,
  					"bindEvent_focusin":false,
  					"bindEvent_autoHideScrollbar":false,
  					/*buttons intervals*/
  					"mCSB_buttonScrollRight":false,
  					"mCSB_buttonScrollLeft":false,
  					"mCSB_buttonScrollDown":false,
  					"mCSB_buttonScrollUp":false
  				});
  				/*max-width/max-height*/
  				if(options.horizontalScroll){
  					if($this.css("max-width")!=="none"){
  						if(!options.advanced.updateOnContentResize){ /*needs updateOnContentResize*/
  							options.advanced.updateOnContentResize=true;
  						}
  					}
  				}else{
  					if($this.css("max-height")!=="none"){
  						var percentage=false,maxHeight=parseInt($this.css("max-height"));
  						if($this.css("max-height").indexOf("%")>=0){
  							percentage=maxHeight,
  							maxHeight=$this.parent().height()*percentage/100;
  						}
  						$this.css("overflow","hidden");
  						mCustomScrollBox.css("max-height",maxHeight);
  					}
  				}
  				$this.mCustomScrollbar("update");
  				/*window resize fn (for layouts based on percentages)*/
  				if(options.advanced.updateOnBrowserResize){
  					var mCSB_resizeTimeout,currWinWidth=$(window).width(),currWinHeight=$(window).height();
  					$(window).bind("resize."+$this.data("mCustomScrollbarIndex"),function(){
  						if(mCSB_resizeTimeout){
  							clearTimeout(mCSB_resizeTimeout);
  						}
  						mCSB_resizeTimeout=setTimeout(function(){
  							if(!$this.is(".mCS_disabled") && !$this.is(".mCS_destroyed")){
  								var winWidth=$(window).width(),winHeight=$(window).height();
  								if(currWinWidth!==winWidth || currWinHeight!==winHeight){ /*ie8 fix*/
  									if($this.css("max-height")!=="none" && percentage){
  										mCustomScrollBox.css("max-height",$this.parent().height()*percentage/100);
  									}
  									$this.mCustomScrollbar("update");
  									currWinWidth=winWidth; currWinHeight=winHeight;
  								}
  							}
  						},150);
  					});
  				}
  				/*content resize fn (for dynamically generated content)*/
  				if(options.advanced.updateOnContentResize){
  					var mCSB_onContentResize;
  					if(options.horizontalScroll){
  						var mCSB_containerOldSize=mCSB_container.outerWidth();
  					}else{
  						var mCSB_containerOldSize=mCSB_container.outerHeight();
  					}
  					mCSB_onContentResize=setInterval(function(){
  						if(options.horizontalScroll){
  							if(options.advanced.autoExpandHorizontalScroll){
  								mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();
  							}
  							var mCSB_containerNewSize=mCSB_container.outerWidth();
  						}else{
  							var mCSB_containerNewSize=mCSB_container.outerHeight();
  						}
  						if(mCSB_containerNewSize!=mCSB_containerOldSize){
  							$this.mCustomScrollbar("update");
  							mCSB_containerOldSize=mCSB_containerNewSize;
  						}
  					},300);
  				}
  			});
  		},
  		update:function(){
  			var $this=$(this),
  				mCustomScrollBox=$this.children(".mCustomScrollBox"),
  				mCSB_container=mCustomScrollBox.children(".mCSB_container");
  			mCSB_container.removeClass("mCS_no_scrollbar");
  			$this.removeClass("mCS_disabled mCS_destroyed");
  			mCustomScrollBox.scrollTop(0).scrollLeft(0); /*reset scrollTop/scrollLeft to prevent browser focus scrolling*/
  			var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
  				mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
  				mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");
  			if($this.data("horizontalScroll")){
  				var mCSB_buttonLeft=mCSB_scrollTools.children(".mCSB_buttonLeft"),
  					mCSB_buttonRight=mCSB_scrollTools.children(".mCSB_buttonRight"),
  					mCustomScrollBoxW=mCustomScrollBox.width();
  				if($this.data("autoExpandHorizontalScroll")){
  					mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();
  				}
  				var mCSB_containerW=mCSB_container.outerWidth();
  			}else{
  				var mCSB_buttonUp=mCSB_scrollTools.children(".mCSB_buttonUp"),
  					mCSB_buttonDown=mCSB_scrollTools.children(".mCSB_buttonDown"),
  					mCustomScrollBoxH=mCustomScrollBox.height(),
  					mCSB_containerH=mCSB_container.outerHeight();
  			}
  			if(mCSB_containerH>mCustomScrollBoxH && !$this.data("horizontalScroll")){ /*content needs vertical scrolling*/
  				mCSB_scrollTools.css("display","block");
  				var mCSB_draggerContainerH=mCSB_draggerContainer.height();
  				/*auto adjust scrollbar dragger length analogous to content*/
  				if($this.data("autoDraggerLength")){
  					var draggerH=Math.round(mCustomScrollBoxH/mCSB_containerH*mCSB_draggerContainerH),
  						minDraggerH=mCSB_dragger.data("minDraggerHeight");
  					if(draggerH<=minDraggerH){ /*min dragger height*/
  						mCSB_dragger.css({"height":minDraggerH});
  					}else if(draggerH>=mCSB_draggerContainerH-10){ /*max dragger height*/
  						var mCSB_draggerContainerMaxH=mCSB_draggerContainerH-10;
  						mCSB_dragger.css({"height":mCSB_draggerContainerMaxH});
  					}else{
  						mCSB_dragger.css({"height":draggerH});
  					}
  					mCSB_dragger.children(".mCSB_dragger_bar").css({"line-height":mCSB_dragger.height()+"px"});
  				}
  				var mCSB_draggerH=mCSB_dragger.height(),
  				/*calculate and store scroll amount, add scrolling*/
  					scrollAmount=(mCSB_containerH-mCustomScrollBoxH)/(mCSB_draggerContainerH-mCSB_draggerH);
  				$this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);
  				/*scroll*/
  				var mCSB_containerP=Math.abs(mCSB_container.position().top);
  				$this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});
  			}else if(mCSB_containerW>mCustomScrollBoxW && $this.data("horizontalScroll")){ /*content needs horizontal scrolling*/
  				mCSB_scrollTools.css("display","block");
  				var mCSB_draggerContainerW=mCSB_draggerContainer.width();
  				/*auto adjust scrollbar dragger length analogous to content*/
  				if($this.data("autoDraggerLength")){
  					var draggerW=Math.round(mCustomScrollBoxW/mCSB_containerW*mCSB_draggerContainerW),
  						minDraggerW=mCSB_dragger.data("minDraggerWidth");
  					if(draggerW<=minDraggerW){ /*min dragger height*/
  						mCSB_dragger.css({"width":minDraggerW});
  					}else if(draggerW>=mCSB_draggerContainerW-10){ /*max dragger height*/
  						var mCSB_draggerContainerMaxW=mCSB_draggerContainerW-10;
  						mCSB_dragger.css({"width":mCSB_draggerContainerMaxW});
  					}else{
  						mCSB_dragger.css({"width":draggerW});
  					}
  				}
  				var mCSB_draggerW=mCSB_dragger.width(),
  				/*calculate and store scroll amount, add scrolling*/
  					scrollAmount=(mCSB_containerW-mCustomScrollBoxW)/(mCSB_draggerContainerW-mCSB_draggerW);
  				$this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);
  				/*scroll*/
  				var mCSB_containerP=Math.abs(mCSB_container.position().left);
  				$this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});
  			}else{ /*content does not need scrolling*/
  				/*unbind events, reset content position, hide scrollbars, remove classes*/
  				mCustomScrollBox.unbind("mousewheel focusin");
  				if($this.data("horizontalScroll")){
  					mCSB_dragger.add(mCSB_container).css("left",0);
  				}else{
  					mCSB_dragger.add(mCSB_container).css("top",0);
  				}
  				if ($this.data("alwaysShowScrollbar")) {
  					if(!$this.data("horizontalScroll")){ /*vertical scrolling*/
  						mCSB_dragger.css({"height":mCSB_draggerContainer.height()});
  					}else if($this.data("horizontalScroll")){ /*horizontal scrolling*/
  						mCSB_dragger.css({"width":mCSB_draggerContainer.width()});
  					}
  				} else {
  					mCSB_scrollTools.css("display","none");
  					mCSB_container.addClass("mCS_no_scrollbar");
  				}
  				$this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false});
  			}
  		},
  		scrolling:function(mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight){
  			var $this=$(this);
  			/*scrollbar drag scrolling*/
  			if(!$this.data("bindEvent_scrollbar_drag")){
  				var mCSB_draggerDragY,mCSB_draggerDragX,
  					mCSB_dragger_downEvent,mCSB_dragger_moveEvent,mCSB_dragger_upEvent;
  				if($.support.pointer){ /*pointer*/
  					mCSB_dragger_downEvent="pointerdown";
  					mCSB_dragger_moveEvent="pointermove";
  					mCSB_dragger_upEvent="pointerup";
  				}else if($.support.msPointer){ /*MSPointer*/
  					mCSB_dragger_downEvent="MSPointerDown";
  					mCSB_dragger_moveEvent="MSPointerMove";
  					mCSB_dragger_upEvent="MSPointerUp";
  				}
  				if($.support.pointer || $.support.msPointer){ /*pointer, MSPointer*/
  					mCSB_dragger.bind(mCSB_dragger_downEvent,function(e){
  						e.preventDefault();
  						$this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");
  						var elem=$(this),
  							elemOffset=elem.offset(),
  							x=e.originalEvent.pageX-elemOffset.left,
  							y=e.originalEvent.pageY-elemOffset.top;
  						if(x<elem.width() && x>0 && y<elem.height() && y>0){
  							mCSB_draggerDragY=y;
  							mCSB_draggerDragX=x;
  						}
  					});
  					$(document).bind(mCSB_dragger_moveEvent+"."+$this.data("mCustomScrollbarIndex"),function(e){
  						e.preventDefault();
  						if($this.data("on_drag")){
  							var elem=mCSB_dragger,
  								elemOffset=elem.offset(),
  								x=e.originalEvent.pageX-elemOffset.left,
  								y=e.originalEvent.pageY-elemOffset.top;
  							scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
  						}
  					}).bind(mCSB_dragger_upEvent+"."+$this.data("mCustomScrollbarIndex"),function(e){
  						$this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");
  					});
  				}else{ /*mouse/touch*/
  					mCSB_dragger.bind("mousedown touchstart",function(e){
  						e.preventDefault(); e.stopImmediatePropagation();
  						var	elem=$(this),elemOffset=elem.offset(),x,y;
  						if(e.type==="touchstart"){
  							var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  							x=touch.pageX-elemOffset.left; y=touch.pageY-elemOffset.top;
  						}else{
  							$this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");
  							x=e.pageX-elemOffset.left; y=e.pageY-elemOffset.top;
  						}
  						if(x<elem.width() && x>0 && y<elem.height() && y>0){
  							mCSB_draggerDragY=y; mCSB_draggerDragX=x;
  						}
  					}).bind("touchmove",function(e){
  						e.preventDefault(); e.stopImmediatePropagation();
  						var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0],
  							elem=$(this),
  							elemOffset=elem.offset(),
  							x=touch.pageX-elemOffset.left,
  							y=touch.pageY-elemOffset.top;
  						scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
  					});
  					$(document).bind("mousemove."+$this.data("mCustomScrollbarIndex"),function(e){
  						if($this.data("on_drag")){
  							var elem=mCSB_dragger,
  								elemOffset=elem.offset(),
  								x=e.pageX-elemOffset.left,
  								y=e.pageY-elemOffset.top;
  							scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
  						}
  					}).bind("mouseup."+$this.data("mCustomScrollbarIndex"),function(e){
  						$this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");
  					});
  				}
  				$this.data({"bindEvent_scrollbar_drag":true});
  			}
  			function scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x){
  				if($this.data("horizontalScroll")){
  					$this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().left-(mCSB_draggerDragX))+x,{moveDragger:true,trigger:"internal"});
  				}else{
  					$this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().top-(mCSB_draggerDragY))+y,{moveDragger:true,trigger:"internal"});
  				}
  			}
  			/*content touch-drag*/
  			if($.support.touch && $this.data("contentTouchScroll")){
  				if(!$this.data("bindEvent_content_touch")){
  					var touch,
  						elem,elemOffset,y,x,mCSB_containerTouchY,mCSB_containerTouchX;
  					mCSB_container.bind("touchstart",function(e){
  						e.stopImmediatePropagation();
  						touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  						elem=$(this);
  						elemOffset=elem.offset();
  						x=touch.pageX-elemOffset.left;
  						y=touch.pageY-elemOffset.top;
  						mCSB_containerTouchY=y;
  						mCSB_containerTouchX=x;
  					});
  					mCSB_container.bind("touchmove",function(e){
  						e.preventDefault(); e.stopImmediatePropagation();
  						touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  						elem=$(this).parent();
  						elemOffset=elem.offset();
  						x=touch.pageX-elemOffset.left;
  						y=touch.pageY-elemOffset.top;
  						if($this.data("horizontalScroll")){
  							$this.mCustomScrollbar("scrollTo",mCSB_containerTouchX-x,{trigger:"internal"});
  						}else{
  							$this.mCustomScrollbar("scrollTo",mCSB_containerTouchY-y,{trigger:"internal"});
  						}
  					});
  				}
  			}
  			/*dragger rail click scrolling*/
  			if(!$this.data("bindEvent_scrollbar_click")){
  				mCSB_draggerContainer.bind("click",function(e){
  					var scrollToPos=(e.pageY-mCSB_draggerContainer.offset().top)*$this.data("scrollAmount"),target=$(e.target);
  					if($this.data("horizontalScroll")){
  						scrollToPos=(e.pageX-mCSB_draggerContainer.offset().left)*$this.data("scrollAmount");
  					}
  					if(target.hasClass("mCSB_draggerContainer") || target.hasClass("mCSB_draggerRail")){
  						$this.mCustomScrollbar("scrollTo",scrollToPos,{trigger:"internal",scrollEasing:"draggerRailEase"});
  					}
  				});
  				$this.data({"bindEvent_scrollbar_click":true});
  			}
  			/*mousewheel scrolling*/
  			if($this.data("mouseWheel")){
  				if(!$this.data("bindEvent_mousewheel")){
  					mCustomScrollBox.bind("mousewheel",function(e,delta){
  						var scrollTo,mouseWheelPixels=$this.data("mouseWheelPixels"),absPos=Math.abs(mCSB_container.position().top),
  							draggerPos=mCSB_dragger.position().top,limit=mCSB_draggerContainer.height()-mCSB_dragger.height();
  						if($this.data("normalizeMouseWheelDelta")){
  							if(delta<0){delta=-1;}else{delta=1;}
  						}
  						if(mouseWheelPixels==="auto"){
  							mouseWheelPixels=100+Math.round($this.data("scrollAmount")/2);
  						}
  						if($this.data("horizontalScroll")){
  							draggerPos=mCSB_dragger.position().left; 
  							limit=mCSB_draggerContainer.width()-mCSB_dragger.width();
  							absPos=Math.abs(mCSB_container.position().left);
  						}
  						if((delta>0 && draggerPos!==0) || (delta<0 && draggerPos!==limit)){e.preventDefault(); e.stopImmediatePropagation();}
  						scrollTo=absPos-(delta*mouseWheelPixels);
  						$this.mCustomScrollbar("scrollTo",scrollTo,{trigger:"internal"});
  					});
  					$this.data({"bindEvent_mousewheel":true});
  				}
  			}
  			/*buttons scrolling*/
  			if($this.data("scrollButtons_enable")){
  				if($this.data("scrollButtons_scrollType")==="pixels"){ /*scroll by pixels*/
  					if($this.data("horizontalScroll")){
  						mCSB_buttonRight.add(mCSB_buttonLeft).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);
  						$this.data({"bindEvent_buttonsContinuous_x":false});
  						if(!$this.data("bindEvent_buttonsPixels_x")){
  							/*scroll right*/
  							mCSB_buttonRight.bind("click",function(e){
  								e.preventDefault();
  								PixelsScrollTo(Math.abs(mCSB_container.position().left)+$this.data("scrollButtons_scrollAmount"));
  							});
  							/*scroll left*/
  							mCSB_buttonLeft.bind("click",function(e){
  								e.preventDefault();
  								PixelsScrollTo(Math.abs(mCSB_container.position().left)-$this.data("scrollButtons_scrollAmount"));
  							});
  							$this.data({"bindEvent_buttonsPixels_x":true});
  						}
  					}else{
  						mCSB_buttonDown.add(mCSB_buttonUp).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);
  						$this.data({"bindEvent_buttonsContinuous_y":false});
  						if(!$this.data("bindEvent_buttonsPixels_y")){
  							/*scroll down*/
  							mCSB_buttonDown.bind("click",function(e){
  								e.preventDefault();
  								PixelsScrollTo(Math.abs(mCSB_container.position().top)+$this.data("scrollButtons_scrollAmount"));
  							});
  							/*scroll up*/
  							mCSB_buttonUp.bind("click",function(e){
  								e.preventDefault();
  								PixelsScrollTo(Math.abs(mCSB_container.position().top)-$this.data("scrollButtons_scrollAmount"));
  							});
  							$this.data({"bindEvent_buttonsPixels_y":true});
  						}
  					}
  					function PixelsScrollTo(to){
  						if(!mCSB_dragger.data("preventAction")){
  							mCSB_dragger.data("preventAction",true);
  							$this.mCustomScrollbar("scrollTo",to,{trigger:"internal"});
  						}
  					}
  				}else{ /*continuous scrolling*/
  					if($this.data("horizontalScroll")){
  						mCSB_buttonRight.add(mCSB_buttonLeft).unbind("click");
  						$this.data({"bindEvent_buttonsPixels_x":false});
  						if(!$this.data("bindEvent_buttonsContinuous_x")){
  							/*scroll right*/
  							mCSB_buttonRight.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
  								e.preventDefault();
  								var scrollButtonsSpeed=ScrollButtonsSpeed();
  								$this.data({"mCSB_buttonScrollRight":setInterval(function(){
  									$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
  								},17)});
  							});
  							var mCSB_buttonRight_stop=function(e){
  								e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollRight"));
  							}
  							mCSB_buttonRight.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonRight_stop);
  							/*scroll left*/
  							mCSB_buttonLeft.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
  								e.preventDefault();
  								var scrollButtonsSpeed=ScrollButtonsSpeed();
  								$this.data({"mCSB_buttonScrollLeft":setInterval(function(){
  									$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
  								},17)});
  							});	
  							var mCSB_buttonLeft_stop=function(e){
  								e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollLeft"));
  							}
  							mCSB_buttonLeft.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonLeft_stop);
  							$this.data({"bindEvent_buttonsContinuous_x":true});
  						}
  					}else{
  						mCSB_buttonDown.add(mCSB_buttonUp).unbind("click");
  						$this.data({"bindEvent_buttonsPixels_y":false});
  						if(!$this.data("bindEvent_buttonsContinuous_y")){
  							/*scroll down*/
  							mCSB_buttonDown.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
  								e.preventDefault();
  								var scrollButtonsSpeed=ScrollButtonsSpeed();
  								$this.data({"mCSB_buttonScrollDown":setInterval(function(){
  									$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
  								},17)});
  							});
  							var mCSB_buttonDown_stop=function(e){
  								e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollDown"));
  							}
  							mCSB_buttonDown.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonDown_stop);
  							/*scroll up*/
  							mCSB_buttonUp.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
  								e.preventDefault();
  								var scrollButtonsSpeed=ScrollButtonsSpeed();
  								$this.data({"mCSB_buttonScrollUp":setInterval(function(){
  									$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
  								},17)});
  							});	
  							var mCSB_buttonUp_stop=function(e){
  								e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollUp"));
  							}
  							mCSB_buttonUp.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonUp_stop);
  							$this.data({"bindEvent_buttonsContinuous_y":true});
  						}
  					}
  					function ScrollButtonsSpeed(){
  						var speed=$this.data("scrollButtons_scrollSpeed");
  						if($this.data("scrollButtons_scrollSpeed")==="auto"){
  							speed=Math.round(($this.data("scrollInertia")+100)/40);
  						}
  						return speed;
  					}
  				}
  			}
  			/*scrolling on element focus (e.g. via TAB key)*/
  			if($this.data("autoScrollOnFocus")){
  				if(!$this.data("bindEvent_focusin")){
  					mCustomScrollBox.bind("focusin",function(){
  						mCustomScrollBox.scrollTop(0).scrollLeft(0);
  						var focusedElem=$(document.activeElement);
  						if(focusedElem.is("input,textarea,select,button,a[tabindex],area,object")){
  							var mCSB_containerPos=mCSB_container.position().top,
  								focusedElemPos=focusedElem.position().top,
  								visibleLimit=mCustomScrollBox.height()-focusedElem.outerHeight();
  							if($this.data("horizontalScroll")){
  								mCSB_containerPos=mCSB_container.position().left;
  								focusedElemPos=focusedElem.position().left;
  								visibleLimit=mCustomScrollBox.width()-focusedElem.outerWidth();
  							}
  							if(mCSB_containerPos+focusedElemPos<0 || mCSB_containerPos+focusedElemPos>visibleLimit){
  								$this.mCustomScrollbar("scrollTo",focusedElemPos,{trigger:"internal"});
  							}
  						}
  					});
  					$this.data({"bindEvent_focusin":true});
  				}
  			}
  			/*auto-hide scrollbar*/
  			if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){
  				if(!$this.data("bindEvent_autoHideScrollbar")){
  					mCustomScrollBox.bind("mouseenter",function(e){
  						mCustomScrollBox.addClass("mCS-mouse-over");
  						functions.showScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));
  					}).bind("mouseleave touchend",function(e){
  						mCustomScrollBox.removeClass("mCS-mouse-over");
  						if(e.type==="mouseleave"){functions.hideScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));}
  					});
  					$this.data({"bindEvent_autoHideScrollbar":true});
  				}
  			}
  		},
  		scrollTo:function(scrollTo,options){
  			var $this=$(this),
  				defaults={
  					moveDragger:false,
  					trigger:"external",
  					callbacks:true,
  					scrollInertia:$this.data("scrollInertia"),
  					scrollEasing:$this.data("scrollEasing")
  				},
  				options=$.extend(defaults,options),
  				draggerScrollTo,
  				mCustomScrollBox=$this.children(".mCustomScrollBox"),
  				mCSB_container=mCustomScrollBox.children(".mCSB_container"),
  				mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
  				mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
  				mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger"),
  				contentSpeed=draggerSpeed=options.scrollInertia,
  				scrollBeginning,scrollBeginningOffset,totalScroll,totalScrollOffset;
  			if(!mCSB_container.hasClass("mCS_no_scrollbar")){
  				$this.data({"mCS_trigger":options.trigger});
  				if($this.data("mCS_Init")){options.callbacks=false;}
  				if(scrollTo || scrollTo===0){
  					if(typeof(scrollTo)==="number"){ /*if integer, scroll by number of pixels*/
  						if(options.moveDragger){ /*scroll dragger*/
  							draggerScrollTo=scrollTo;
  							if($this.data("horizontalScroll")){
  								scrollTo=mCSB_dragger.position().left*$this.data("scrollAmount");
  							}else{
  								scrollTo=mCSB_dragger.position().top*$this.data("scrollAmount");
  							}
  							draggerSpeed=0;
  						}else{ /*scroll content by default*/
  							draggerScrollTo=scrollTo/$this.data("scrollAmount");
  						}
  					}else if(typeof(scrollTo)==="string"){ /*if string, scroll by element position*/
  						var target;
  						if(scrollTo==="top"){ /*scroll to top*/
  							target=0;
  						}else if(scrollTo==="bottom" && !$this.data("horizontalScroll")){ /*scroll to bottom*/
  							target=mCSB_container.outerHeight()-mCustomScrollBox.height();
  						}else if(scrollTo==="left"){ /*scroll to left*/
  							target=0;
  						}else if(scrollTo==="right" && $this.data("horizontalScroll")){ /*scroll to right*/
  							target=mCSB_container.outerWidth()-mCustomScrollBox.width();
  						}else if(scrollTo==="first"){ /*scroll to first element position*/
  							target=$this.find(".mCSB_container").find(":first");
  						}else if(scrollTo==="last"){ /*scroll to last element position*/
  							target=$this.find(".mCSB_container").find(":last");
  						}else{ /*scroll to element position*/
  							target=$this.find(scrollTo);
  						}
  						if(target.length===1){ /*if such unique element exists, scroll to it*/
  							if($this.data("horizontalScroll")){
  								scrollTo=target.position().left;
  							}else{
  								scrollTo=target.position().top;
  							}
  							draggerScrollTo=scrollTo/$this.data("scrollAmount");
  						}else{
  							draggerScrollTo=scrollTo=target;
  						}
  					}
  					/*scroll to*/
  					if($this.data("horizontalScroll")){
  						if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/
  							scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");
  						}
  						if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/
  							totalScrollOffset=mCustomScrollBox.width()-mCSB_container.outerWidth()+$this.data("onTotalScroll_Offset");
  						}
  						if(draggerScrollTo<0){ /*scroll start position*/
  							draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollLeft"));
  							if(!scrollBeginningOffset){scrollBeginning=true;}
  						}else if(draggerScrollTo>=mCSB_draggerContainer.width()-mCSB_dragger.width()){ /*scroll end position*/
  							draggerScrollTo=mCSB_draggerContainer.width()-mCSB_dragger.width();
  							scrollTo=mCustomScrollBox.width()-mCSB_container.outerWidth(); clearInterval($this.data("mCSB_buttonScrollRight"));
  							if(!totalScrollOffset){totalScroll=true;}
  						}else{scrollTo=-scrollTo;}
  						var snapAmount = $this.data("snapAmount");
  						if (snapAmount) {
  							scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");
  						}
  						/*scrolling animation*/
  						functions.mTweenAxis.call(this,mCSB_dragger[0],"left",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);
  						functions.mTweenAxis.call(this,mCSB_container[0],"left",Math.round(scrollTo),contentSpeed,options.scrollEasing,{
  							onStart:function(){
  								if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}
  								if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}
  							},
  							onUpdate:function(){
  								if(options.callbacks){callbacks("whileScrolling");}
  							},
  							onComplete:function(){
  								if(options.callbacks){
  									callbacks("onScroll");
  									if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().left>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}
  									if(totalScroll || (totalScrollOffset && mCSB_container.position().left<=totalScrollOffset)){callbacks("onTotalScroll");}
  								}
  								mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);
  								if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}
  							}
  						});
  					}else{
  						if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/
  							scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");
  						}
  						if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/
  							totalScrollOffset=mCustomScrollBox.height()-mCSB_container.outerHeight()+$this.data("onTotalScroll_Offset");
  						}
  						if(draggerScrollTo<0){ /*scroll start position*/
  							draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollUp"));
  							if(!scrollBeginningOffset){scrollBeginning=true;}
  						}else if(draggerScrollTo>=mCSB_draggerContainer.height()-mCSB_dragger.height()){ /*scroll end position*/
  							draggerScrollTo=mCSB_draggerContainer.height()-mCSB_dragger.height();
  							scrollTo=mCustomScrollBox.height()-mCSB_container.outerHeight(); clearInterval($this.data("mCSB_buttonScrollDown"));
  							if(!totalScrollOffset){totalScroll=true;}
  						}else{scrollTo=-scrollTo;}
  						var snapAmount = $this.data("snapAmount");
  						if (snapAmount) {
  							scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");
  						}
  						/*scrolling animation*/
  						functions.mTweenAxis.call(this,mCSB_dragger[0],"top",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);
  						functions.mTweenAxis.call(this,mCSB_container[0],"top",Math.round(scrollTo),contentSpeed,options.scrollEasing,{
  							onStart:function(){
  								if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}
  								if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}
  							},
  							onUpdate:function(){
  								if(options.callbacks){callbacks("whileScrolling");}
  							},
  							onComplete:function(){
  								if(options.callbacks){
  									callbacks("onScroll");
  									if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().top>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}
  									if(totalScroll || (totalScrollOffset && mCSB_container.position().top<=totalScrollOffset)){callbacks("onTotalScroll");}
  								}
  								mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);
  								if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}
  							}
  						});
  					}
  					if($this.data("mCS_Init")){$this.data({"mCS_Init":false});}
  				}
  			}
  			/*callbacks*/
  			function callbacks(cb){
  				if ($this.data("mCustomScrollbarIndex")) {
  					this.mcs = {
  						top: mCSB_container.position().top, left: mCSB_container.position().left,
  						draggerTop: mCSB_dragger.position().top, draggerLeft: mCSB_dragger.position().left,
  						topPct: Math.round((100 * Math.abs(mCSB_container.position().top)) / Math.abs(mCSB_container.outerHeight() - mCustomScrollBox.height())),
  						leftPct: Math.round((100 * Math.abs(mCSB_container.position().left)) / Math.abs(mCSB_container.outerWidth() - mCustomScrollBox.width()))
  					};
  					switch (cb) {
  						/*start scrolling callback*/
  						case "onScrollStart":
  							$this.data("mCS_tweenRunning", true).data("onScrollStart_Callback").call($this, this.mcs);
  							break;
  						case "whileScrolling":
  							$this.data("whileScrolling_Callback").call($this, this.mcs);
  							break;
  						case "onScroll":
  							$this.data("onScroll_Callback").call($this, this.mcs);
  							break;
  						case "onTotalScrollBack":
  							$this.data("onTotalScrollBack_Callback").call($this, this.mcs);
  							break;
  						case "onTotalScroll":
  							$this.data("onTotalScroll_Callback").call($this, this.mcs);
  							break;
  					}
  				}
  			}
  		},
  		stop:function(){
  			var $this=$(this),
  				mCSB_container=$this.children().children(".mCSB_container"),
  				mCSB_dragger=$this.children().children().children().children(".mCSB_dragger");
  			functions.mTweenAxisStop.call(this,mCSB_container[0]);
  			functions.mTweenAxisStop.call(this,mCSB_dragger[0]);
  		},
  		disable:function(resetScroll){
  			var $this=$(this),
  				mCustomScrollBox=$this.children(".mCustomScrollBox"),
  				mCSB_container=mCustomScrollBox.children(".mCSB_container"),
  				mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
  				mCSB_dragger=mCSB_scrollTools.children().children(".mCSB_dragger");
  			mCustomScrollBox.unbind("mousewheel focusin mouseenter mouseleave touchend");
  			mCSB_container.unbind("touchstart touchmove")
  			if(resetScroll){
  				if($this.data("horizontalScroll")){
  					mCSB_dragger.add(mCSB_container).css("left",0);
  				}else{
  					mCSB_dragger.add(mCSB_container).css("top",0);
  				}
  			}
  			mCSB_scrollTools.css("display","none");
  			mCSB_container.addClass("mCS_no_scrollbar");
  			$this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false,"bindEvent_content_touch":false,"bindEvent_autoHideScrollbar":false}).addClass("mCS_disabled");
  		},
  		destroy:function(){
  			var $this=$(this);
  			$this.removeClass("mCustomScrollbar _mCS_"+$this.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();
  			$(document).unbind("mousemove."+$this.data("mCustomScrollbarIndex")+" mouseup."+$this.data("mCustomScrollbarIndex")+" MSPointerMove."+$this.data("mCustomScrollbarIndex")+" MSPointerUp."+$this.data("mCustomScrollbarIndex"));
  			$(window).unbind("resize."+$this.data("mCustomScrollbarIndex"));
  		}
  	},
  	functions={
  		/*hide/show scrollbar*/
  		showScrollbar:function(){
  			this.stop().animate({opacity:1},"fast");
  		},
  		hideScrollbar:function(){
  			this.stop().animate({opacity:0},"fast");
  		},
  		/*js animation tween*/
  		mTweenAxis:function(el,prop,to,duration,easing,callbacks){
  			var callbacks=callbacks || {},
  				onStart=callbacks.onStart || function(){},onUpdate=callbacks.onUpdate || function(){},onComplete=callbacks.onComplete || function(){};
  			var startTime=_getTime(),_delay,progress=0,from=el.offsetTop,elStyle=el.style;
  			if(prop==="left"){from=el.offsetLeft;}
  			var diff=to-from;
  			_cancelTween();
  			_startTween();
  			function _getTime(){
  				if(window.performance && window.performance.now){
  					return window.performance.now();
  				}else{
  					if(window.performance && window.performance.webkitNow){
  						return window.performance.webkitNow();
  					}else{
  						if(Date.now){return Date.now();}else{return new Date().getTime();}
  					}
  				}
  			}
  			function _step(){
  				if(!progress){onStart.call();}
  				progress=_getTime()-startTime;
  				_tween();
  				if(progress>=el._time){
  					el._time=(progress>el._time) ? progress+_delay-(progress- el._time) : progress+_delay-1;
  					if(el._time<progress+1){el._time=progress+1;}
  				}
  				if(el._time<duration){el._id=_request(_step);}else{onComplete.call();}
  			}
  			function _tween(){
  				if(duration>0){
  					el.currVal=_ease(el._time,from,diff,duration,easing);
  					elStyle[prop]=Math.round(el.currVal)+"px";
  				}else{
  					elStyle[prop]=to+"px";
  				}
  				onUpdate.call();
  			}
  			function _startTween(){
  				_delay=1000/60;
  				el._time=progress+_delay;
  				_request=(!window.requestAnimationFrame) ? function(f){_tween(); return setTimeout(f,0.01);} : window.requestAnimationFrame;
  				el._id=_request(_step);
  			}
  			function _cancelTween(){
  				if(el._id==null){return;}
  				if(!window.requestAnimationFrame){clearTimeout(el._id);
  				}else{window.cancelAnimationFrame(el._id);}
  				el._id=null;
  			}
  			function _ease(t,b,c,d,type){
  				switch(type){
  					case "linear":
  						return c*t/d + b;
  						break;
  					case "easeOutQuad":
  						t /= d; return -c * t*(t-2) + b;
  						break;
  					case "easeInOutQuad":
  						t /= d/2;
  						if (t < 1) return c/2*t*t + b;
  						t--;
  						return -c/2 * (t*(t-2) - 1) + b;
  						break;
  					case "easeOutCubic":
  						t /= d; t--; return c*(t*t*t + 1) + b;
  						break;
  					case "easeOutQuart":
  						t /= d; t--; return -c * (t*t*t*t - 1) + b;
  						break;
  					case "easeOutQuint":
  						t /= d; t--; return c*(t*t*t*t*t + 1) + b;
  						break;
  					case "easeOutCirc":
  						t /= d; t--; return c * Math.sqrt(1 - t*t) + b;
  						break;
  					case "easeOutSine":
  						return c * Math.sin(t/d * (Math.PI/2)) + b;
  						break;
  					case "easeOutExpo":
  						return c * ( -Math.pow( 2, -10 * t/d ) + 1 ) + b;
  						break;
  					case "mcsEaseOut":
  						var ts=(t/=d)*t,tc=ts*t;
  						return b+c*(0.499999999999997*tc*ts + -2.5*ts*ts + 5.5*tc + -6.5*ts + 4*t);
  						break;
  					case "draggerRailEase":
  						t /= d/2;
  						if (t < 1) return c/2*t*t*t + b;
  						t -= 2;
  						return c/2*(t*t*t + 2) + b;
  						break;
  				}
  			}
  		},
  		/*stop js animation tweens*/
  		mTweenAxisStop:function(el){
  			if(el._id==null){return;}
  			if(!window.requestAnimationFrame){clearTimeout(el._id);
  			}else{window.cancelAnimationFrame(el._id);}
  			el._id=null;
  		},
  		/*detect requestAnimationFrame and polyfill*/
  		rafPolyfill:function(){
  			var pfx=["ms","moz","webkit","o"],i=pfx.length;
  			while(--i > -1 && !window.requestAnimationFrame){
  				window.requestAnimationFrame=window[pfx[i]+"RequestAnimationFrame"];
  				window.cancelAnimationFrame=window[pfx[i]+"CancelAnimationFrame"] || window[pfx[i]+"CancelRequestAnimationFrame"];
  			}
  		}
  	}
  	/*detect features*/
  	functions.rafPolyfill.call(); /*requestAnimationFrame*/
  	$.support.touch=!!('ontouchstart' in window); /*touch*/
  	$.support.pointer=window.navigator.pointerEnabled; /*pointer support*/
  	$.support.msPointer=window.navigator.msPointerEnabled; /*MSPointer support*/
  	/*plugin dependencies*/
  	var _dlp=("https:"==document.location.protocol) ? "https:" : "http:";
  	/*$.event.special.mousewheel || document.write('<script src="'+_dlp+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');*/
  	$.event.special.mousewheel || document.write('<script src="'+'//www.lgstatic.com/lg-community-fed/dep/jquery-mousewheel/jquery.mousewheel_ea9cfa5.js'+'"><\/script>');
  	/*plugin fn*/
  	$.fn.mCustomScrollbar=function(method){
  		if(methods[method]){
  			return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
  		}else if(typeof method==="object" || !method){
  			return methods.init.apply(this,arguments);
  		}else{
  			$.error("Method "+method+" does not exist");
  		}
  	};
  })(jQuery);
  

});
;/*!/common/widgets/passport/passport.js*/
define('common/widgets/passport/passport', ['require', 'exports', 'module', "common/widgets/passport/modules/login/main", "common/widgets/passport/modules/register/main", "common/widgets/passport/utils/index", "common/components/util/emitter", "common/widgets/passport/dep/md5/md5"], function (require, exports, module) {

    var showLoginPop = require("common/widgets/passport/modules/login/main");
    var showRegisterPop = require("common/widgets/passport/modules/register/main");
    var util = require("common/widgets/passport/utils/index");
    var Emitter = require("common/components/util/emitter");
    var emitterControler = new Emitter();
    window.md5 = require("common/widgets/passport/dep/md5/md5");

    /**
     * 请求目标地址
     * @type {Object}
     */
    var REMOTE = {

        // 中心
        server: 'https://passport.lagou.com',

        // 弹框登录的提交地址
        poplogin: '/login/login.json',

        // 弹窗登录中转
        poptransfer: '/ajaxLogin/frameGrant.html',

        // 自动登录中转
        autologin: '/ajaxLogin/login.html'

    };

    /**
     * 用来保存回调函数，键名既是index
     *
     * @type {Object}
     */
    var CALLBACKS = {

        // 远程调用的回调
        remote: {
            // 以index为索引
            // 2: {
            //     succ: func..
            //     fail: func..
            // }
        }

    };

    /**
     * 使用PASSPORT全局变量对外
     * @type {Object}
     */
    window.PASSPORT = window.PASSPORT || {

        /**
         * 绑定自定义事件【针对`auto`，`popup`的监听器】
         * @param  {string} event    事件类型
         * @param  {Function} listener  监听器
         */
        on: function () {
            emitterControler.on.apply(emitterControler, arguments);
        },

        /**
         * 触发自动登录
         * @desc 监听事件[ autologin:xxx ]
         */
        auto: function () {
            var index = util.iframe.getUniqueIndex();
            var turl = util.getTargetUrl(
                REMOTE.server + REMOTE.autologin, {
                    fl: '1',
                    service: document.URL,
                    osc: 'PASSPORT._ascb(' + index + ')',
                    ofc: 'PASSPORT._afcb(' + index + ')'
                }
            );
            util.iframe.createIframe('auto_login_iframe', turl, index);
        },

        /**
         * 以下两个为自动登录的回调
         *
         * @private
         * @param  {[type]} data [description]
         */
        _ascb: function (index, data) {
            util.tinfo('Call of PASSPORT._ascb' + index + ': ' + data);
            emitterControler.emit('autologin:succ', data);
            util.iframe.delIframe('auto_login_iframe', index);
        },
        _afcb: function (index, data) {
            util.tinfo('Call of PASSPORT._afcb' + index + ': ' + data);
            emitterControler.emit('autologin:fail', data);
            util.iframe.delIframe('auto_login_iframe', index);
        },

        /**
         * 可以被主动调用的登录弹窗
         */
        loginPopup: showLoginPop,

        registerPopup: showRegisterPop,

        /**
         * 以下两个为弹窗登录的回调
         *
         * @private
         * @param  {[type]} data [description]
         */
        _pscb: function (index, data) {
            util.tinfo('Call of PASSPORT._pscb' + index + ': ' + data);
            emitterControler.emit('popuplogin:succ', data);
            util.iframe.delIframe('popup_login_iframe', index);
        },
        _pfcb: function (index, data) {
            util.tinfo('Call of PASSPORT._pfcb' + index + ': ' + data);
            emitterControler.emit('popuplogin:fail', data);
            util.iframe.delIframe('popup_login_iframe', index);
        },

        /**
         * 远程登录
         * @param  {string} server 响应出10001的接口url
         */
        remote: function (server, succ, fail) {
            util.tinfo('Remote request: ' + server + ' ' + succ + ' ' + fail);
            var index = util.iframe.getUniqueIndex();
            // 放入回调
            CALLBACKS.remote[index] = {};
            if (succ) {
                CALLBACKS.remote[index].succ = succ;
            }
            if (fail) {
                CALLBACKS.remote[index].fail = fail;
            }
            util.tinfo('Remote request put into callbacks: ' + JSON.stringify(
                CALLBACKS.remote));
            
            var turl = util.getTargetUrl(
                REMOTE.server + REMOTE.autologin, {
                    fl: '3',
                    service: server,
                    osc: 'PASSPORT._rscb(' + index + ')',
                    ofc: 'PASSPORT._rfcb(' + index + ')'
                }
            );
            util.iframe.createIframe('remote_login_iframe', turl, index);
        },

        /**
         * 以下两个为远程登录的回调
         *
         * @private
         * @param  {[type]} data [description]
         */
        _rscb: function (index, data) {
            util.tinfo('Call of PASSPORT._rscb' + index + ': ' + data);
            emitterControler.emit('remotelogin:succ', data);
            util.iframe.delIframe('remote_login_iframe', index);
            // 触发回调函数
            CALLBACKS.remote[index] && CALLBACKS.remote[index].succ && CALLBACKS.remote[index].succ(data);
        },
        _rfcb: function (index, data) {
            util.tinfo('Call of PASSPORT._rfcb' + index + ': ' + data);
            emitterControler.emit('remotelogin:fail', data);
            util.iframe.delIframe('remote_login_iframe', index);
            // 触发回调函数
            CALLBACKS.remote[index] && CALLBACKS.remote[index].fail && CALLBACKS.remote[index].fail(data);
        },

        util: {
            rpc: util.rpc,
            tinfo: util.tinfo,
            iframe: util.iframe,
            getTargetUrl: util.getTargetUrl
        }

    };

});

;/*!/common/widgets/plat/exposure.js*/
/*
 * 曝光量统计
 *
 * 接口地址
 * http://a.lagou.com/json
 *
 * 参数示例：
 * 参数 - 值 - 含义
 * lt - trackshow - 日志输出类型
 * a - 9R00_idnull_0_id34_1992,9R00_idnull_0_id34_1993,9R00_idnull_0_id34_1994 - 编码id组
 * t - p - 曝光类型
 * v - 0 - 版本号
 * dl - http://www.lagou.com/jobs/618831.html - 当前URL
 * dr - http://www.lagou.com - referrer
 * time - new Date().getTime() - 随机码
 *
 *
 */
define('common/widgets/plat/exposure', ['require', 'exports', 'module'], function(require, exports, module) {

    exports.exposure = exposure;

    var analyseUri = {
        jsonURL: document.location.protocol + '//a.lagou.com/json'
    };

    /**
     * [发送广告曝光量统计]
     * @param  {Array} tjCodes  [要统计的编码code组，每一项均为'[tgId, tgNo, tgCid]'格式的统计编码组]
     * @param  {String} type    [曝光统计的类型]
     * @param  {Array} abts     [a/b-test类型，可选]
     */
    function exposure(tjCodes, type, abts) {

        var tjCodesStrs = [];
        for (var i = 0; i < tjCodes.length; i++) {
            tjCodesStrs.push(getTjId(tjCodes[i][0], tjCodes[i][1], tjCodes[i][2]));
        };

        var imgGet = new Image();
        var params = {
            "lt": 'trackshow',
            "a": tjCodesStrs.join(','),
            "t": type || '',
            "v": 0,
            "dl": encodeURIComponent(window.location.href),
            "dr": encodeURIComponent(window.location.protocol + '//' + window.location.hostname),
            "time": new Date().getTime()
        }
        typeof abts !== 'undefined' && (params.abt = abts.join(','));
        paramsArr = [];
        for (var item in params) {
            paramsArr.push(item + '=' + params[item]);
        }
        imgGet.src = analyseUri.jsonURL + '?' + paramsArr.join('&');
    }

    /* 获取编码统计ID */
    function getTjId(id, no, cid) {
        return [$.trim(id), $.trim(no), 0, $.trim(cid), Math.round(Math.random() * 10000)].join('_');
    }

    /* show日志曝光统计 post jobs id array to plat */
    exports.postoA = function(params) {
        if (!params) return;
        var arr = [];
        var img = new Image();
        for (var i in params) {
            arr.push(i + '=' + params[i]);
        }
        arr.push('time=' + new Date().getTime())
        img.src = document.location.protocol + '//a.lagou.com/show?' + arr.join('&');
    }

});

;/*!/common/widgets/plat/poster.js*/
/*
 * 广告位--异步iframe/div方式
 * 在页面上添加如
 * <div key="SPACE_KEY_xxx" keywordSelector="#keyword"></div>
 * 的结构，xxx为广告位的key，keywordSelector="#keyword"为搜索结果页可选项（根据关键词投放广告）
 *
 * 广告位单图jsonp方式
 * 在页面中添加如
 * <div key="xxx" class="lgad_jsonp"></div>
 * 的结构，xxx为广告位的key，若需要曝光量统计可添加class="ad_exposure"
 * class="lgad_jsonp"可选，页面加载完后会自动为含有class="lgad_jsonp"的容器加载广告，也可以根据需要使用 getSingleAd 方法自定义容器手动触发
 *
 * 广告位多图jsonp方式
 * 在页面中添加如
 * <div key="xxx" class="multi_lgad_jsonp"></div>
 * 的结构，xxx为广告位的key，若需要曝光量统计添加类名ad_exposure
 * class="multi_lgad_jsonp"可选，页面加载完后会自动为含有class="multi_lgad_jsonp"的容器加载广告，也可以根据需要使用 getMultipleAds 方法自定义容器手动触发
 *
 *
 * 通用编码统计-广告类型曝光量统计使用方式--同步方式
 * 在要统计的标签上添加tj_exposure类名以及编码统计所需属性
 *
 * 通用编码统计-广告类型曝光量统计使用方式--异步方式
 * 在要统计的标签上添加tj_exposure类名以及编码统计所需属性,在异步加载DOM操作结束后，使用模块exports出的方法sendStatistics()
 *
 */
define('common/widgets/plat/poster', ['require', 'exports', 'module', 'common/widgets/plat/exposure'], function(require, exports, module) {

    var exposure = require('common/widgets/plat/exposure').exposure;

    exports.sendStatistics = pushStatistics;
    exports.getSingleAd = getSingleAd;
    exports.getMultipleAds = getMultipleAds;

    var analyseUri = {
        jsonURL: document.location.protocol + '//a.lagou.com/json'
    };

    /**
     * [getSingleAd 广告位单图jsonp方式]
     * @containerSelector  {[String]} containerSelector [必选，若为''或者null，广告位容器选择器为默认值'.lgad_container'，若使用默认选择器在广告加载完毕后会自动删除'lgad_container'类名]
     * @handler  {[function]} handler           [回调函数]
     */
    function getSingleAd(containerSelector, handler) {
        var selector = containerSelector || '.lgad_container';
        if ($(selector).size() < 1) {
            return;
        }
        $(selector).each(function(i, e) {
            var key = $(e).attr('key'),
                keyword = $('#keyword').val();

            if (!!$(e).data('loadAdAlready')) {
                return;
            }
            $(e).data('loadAdAlready', 1);

            $.getJSON(document.location.protocol + '//ggservice.lagou.com/promotionSpace/data?callback=?', {
                spaceKey: key,
                keyword: keyword,
                subsite: $('#subsiteCity').val() || '全国'
            }, function(json, textStatus) {
                if (json.success && json.data.promotionAds.length > 0) {
                    var imgSrc = (json.data.promotionAds[0].img1 || '').replace(/^https?\:\/\/www\.lagou\.com/i, GLOBAL_DOMAIN.lgsctx),
                        width = json.data.promotionAds[0].width || json.data.width,
                        height = json.data.promotionAds[0].height || json.data.height,
                        link = json.data.promotionAds[0].link1,
                        tjId = json.data.tgCode,
                        tjCid = json.data.promotionAds[0].id || 'idnull';

                    if (!imgSrc) {
                        return;
                    }

                    var imgObj = $('<img src="' + imgSrc + '" />');
                    $(e).append(imgObj);
                    width && imgObj.width(width);
                    height && imgObj.height(height);
                    if (link) {
                        if (tjId) {
                            imgObj.wrap('<a href="' + link + '" data-lg-tj-id="' + tjId + '" data-lg-tj-no="idnull" data-lg-tj-cid="' + tjCid + '" target="_blank" rel="nofollow"></a>');
                            if ($(e).hasClass('ad_exposure')) {
                                exposure([
                                    [tjId, 'idnull', tjCid]
                                ], 'ad');
                                $(e).removeClass('ad_exposure');
                            }
                        } else {
                            imgObj.wrap('<a href="' + link + '" target="_blank" rel="nofollow"></a>');
                        }
                    }
                    $(e).removeClass('lgad_container');
                    handler && handler();
                    //重置页尾位置
                    $(window).trigger('resize');
                } else {
                    $(e).remove();
                }
            });
        });
    }
    getSingleAd('.lgad_jsonp');

    /**
     * [getMultipleAds 广告位多图jsonp方式]
     * @containerSelector  {[String]} containerSelector [必选，若为''或者null，广告位容器选择器为默认值'.multi_lgad_container'，若使用默认选择器在广告加载完毕后会自动删除'multi_lgad_container'类名]
     * @handler  {[function]} handler           [回调函数]
     */
    function getMultipleAds(containerSelector, handler) {
        var selector = containerSelector || '.multi_lgad_container';
        if ($(selector).size() < 1) {
            return;
        }
        $(selector).each(function(i, e) {
            var key = $(e).attr('key'),
                keyword = $('#keyword').val();

            if (!!$(e).data('loadAdAlready')) {
                return;
            }
            $(e).data('loadAdAlready', 1);

            $.getJSON(document.location.protocol + '//ggservice.lagou.com/promotionSpace/data?callback=?', {
                spaceKey: key,
                keyword: keyword,
                subsite: $('#subsiteCity').val() || '全国'
            }, function(json, textStatus) {
                if (json.success && json.data.promotionAds.length > 0) {
                    var exposureArr = [];
                    for (var k = 0; k < json.data.promotionAds.length; k++) {
                        var imgSrc = (json.data.promotionAds[k].img1 || '').replace(/^https?\:\/\/www\.lagou\.com/i, GLOBAL_DOMAIN.lgsctx),
                            width = json.data.promotionAds[k].width || json.data.width,
                            height = json.data.promotionAds[k].height || json.data.height,
                            link = json.data.promotionAds[k].link1,
                            tjId = json.data.tgCode,
                            tjNo = '00' + (k + 1 > 9 ? k + 1 : '0' + (k + 1)),
                            tjCid = json.data.promotionAds[k].id || 'idnull';

                        if (!imgSrc) {
                            continue;
                        }

                        var imgObj = $('<img src="' + imgSrc + '" />');
                        $(e).append(imgObj);
                        width && imgObj.width(width);
                        height && imgObj.height(height);
                        if (link) {
                            if (tjId) {
                                imgObj.wrap('<a href="' + link + '" data-lg-tj-id="' + tjId + '" data-lg-tj-no="' + tjNo + '" data-lg-tj-cid="' + tjCid + '" target="_blank" rel="nofollow"></a>');
                                exposureArr.push([tjId, tjNo, tjCid]);
                            } else {
                                imgObj.wrap('<a href="' + link + '" target="_blank" rel="nofollow"></a>');
                            }
                        }
                        $(e).removeClass('multi_lgad_container');
                    }

                    if ($(e).hasClass('ad_exposure') && exposureArr.length > 0) {
                        exposure(exposureArr, 'ad');
                        $(e).removeClass('ad_exposure');
                    }

                    handler && handler();
                    //重置页尾位置
                    $(window).trigger('resize');
                } else {
                    $(e).remove();
                }
            });
        });
    }
    getMultipleAds('.multi_lgad_jsonp');

    /* 曝光量统计 */
    function pushStatistics() {
        var tjCodesArr = [];
        $('.tj_exposure').each(function(i, e) {
            if ($(e).attr('data-lg-tj-id')) {
                var tjId = $(e).attr('data-lg-tj-id') || 'idnull',
                    tjNo = $(e).attr('data-lg-tj-no') || 'idnull',
                    tjCid = $(e).attr('data-lg-tj-cid') || 'idnull';
                tjCodesArr.push([tjId, tjNo, tjCid]);
                $(e).removeClass('tj_exposure');
            }
        });
        if (tjCodesArr.length > 0) {
            exposure(tjCodesArr, 'ad');
        }
    }

    pushStatistics();

    /* 广告--iframe/div方式 暂时只支持单广告位单广告*/
    if ($('div[key^=SPACE_KEY_]').size() > 0) {
        $('div[key^=SPACE_KEY_]').each(function(i, e) {
            var key = $(e).attr('key').substr(10, 1000);
            var keywordSelector = $(e).attr('keywordSelector');
            var url = window.location.protocol + '//ggservice.lagou.com/promotionSpace/haveData?spaceKey=' + key;
            if (keywordSelector) {
                var keyword = $(keywordSelector).val() || $(keywordSelector).text();
                keyword = $.trim(keyword)
                keyword && (url += '&keyword=' + encodeURIComponent(keyword));
            }
            $.lgAjax({
                url: url,
                dataType: 'jsonp'
            }).done(function(data) {
                if (!data.success) {
                    $('div[key=SPACE_KEY_' + data.spaceKey + ']').remove();
                    return;
                }
                if (data.htmlType == undefined || data.htmlType == 'iframe') {
                    var iframeUrl = window.location.protocol + '//ggservice.lagou.com/promotionSpace/htmlPage?spaceKey=' + data.spaceKey;
                    if (data.data) {
                        iframeUrl += '&keyword=' + encodeURIComponent(data.data);
                    }
                    var $iframe = $('<iframe frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0"></iframe>').appendTo($('div[key=SPACE_KEY_' + data.spaceKey + ']'));
                    $iframe.attr('src', iframeUrl);
                    $iframe.attr('width', data.width);
                    $iframe.attr('height', data.height);
                    $iframe.css({
                        'display': 'block',
                        'border': '0'
                    });
                } else {
                    var $container = $('div[key=SPACE_KEY_' + data.spaceKey + ']').append('<div></div>');
                    $container.css({
                        'width': data.width + 'px',
                        'height': data.height + 'px',
                        'overflow': 'hidden'
                    });

                    var divUrl = window.location.protocol + '//ggservice.lagou.com/promotionSpace/htmldata?spaceKey=' + data.spaceKey;
                    if (data.data) {
                        divUrl += '&keyword=' + encodeURIComponent(data.data);
                    }
                    $.lgAjax({
                        url: divUrl,
                        dataType: 'jsonp'
                    }).done(function(data) {
                        $container.html(data.data);
                    }).fail(function() {
                        $('div[key=SPACE_KEY_' + data.spaceKey + ']').remove();
                    });
                }
            }).fail(function() {
                $('div[key=SPACE_KEY_' + data.spaceKey + ']').remove();
            });
        });
    }

});
